import { ReqPage } from ".";
import { Customer, Material } from "./basic";
import { Receive } from "./receive";

export namespace WorkerSo {
  // 保存工单
  export interface Save {
    id: number;
    customerId: number;
    workerFlag: string;
    line: string;
    planStart: string;
    planEnd: string;
    remark: string;
    flagMerge: number;
  }

  // 查询工单参数
  export interface ReqSearchParams extends ReqPage {
    customerId?: number;
    line?: string;
    key?: string;
    flagStart?: string;
    flagEnd?: string;
    planStart?: string;
    planEnd?: string;
  }
  // 查询工单
  export interface Search {
    records: SearchProps[];
  }

  // 查询工单
  export interface SearchProps extends Customer.c_SearchProp {
    id: number;
    flagMergeName: string;
    workerCode: string;
    customerId: number;
    workerFlag: string;
    customerObj: Customer.SearchProp;
    line: string;
    flagMerge: number;
    planStart: string;
    planEnd: string;
    remark: string;
    flagStart: number;
    doStarttime: string;
    flagEnd: number;
    doEndtime: string;
    doAlong: any;
    douser: string;
    dotime: string;
    uptime: string;
    itemIds: string;
  }

  // 引入工单数据
  export interface W_Search {
    w_id: number;
    w_workerCode: string;
    w_customerId: number;
    w_workerFlag: string;
    w_line: string;
    w_flagMerge: number;
    w_planStart: string;
    w_planEnd: string;
    w_remark: string;
    w_flagStart: number;
    w_doStarttime: string;
    w_flagEnd: number;
    w_doEndtime: string;
    w_doAlong: number;
    w_douser: string;
    w_dotime: string;
    w_uptime: string;
    w_itemIds: null;
  }

  // 查询工单明细
  export interface SearchDetail extends Customer.c_SearchProp, Material.M_resSoSearch {
    id: number;
    warehouse: string;
    flagMerge: number;
    flagSsConfirm?: number;
    location: string;
    _wmsLocation?: string;
    _location?: string;
    _netWeight: string;
    flagSo: number | string;
    flagSplit: number | string;
    sourceType: string;
    sourceId: number;
    batchCode: string;
    customerId: number;
    customerObj: Customer.SearchProp;
    materialObj: Material.SearchProp;
    receiveItemObj: Receive.ReqSaveDetail;
    materialId: number;
    netWeight: number;
    inTime: string;
    packageNum: number;
    outType: string;
    outTime: string;
    outId: number;
    remark: string;
    status: number;
    douser: string;
    dotime: string;
    uptime: string;
    flagLock: number;
    flagSend: number;
    sendTime: string;
    flagAccept: number;
    acceptTime: string;
  }

  // 待入库明细

  // 查询工单明细
  export interface SendSearch extends Customer.c_SearchProp {
    customerId: number;
    customerObj: Customer.SearchProp;
    doAlong: number;
    doEndtime: string;
    doStarttime: string;
    dotime: string;
    douser: string;
    flagEnd: number;
    flagMerge: number;
    flagStart: number;
    id: number;
    itemIds: string;
    line: string;
    planEnd: string;
    planStart: string;
    remark: string;
    uptime: string;
    workerCode: string;
    workerFlag: string;
  }

  export interface WaitAppendItem {
    key: string;
    value: SearchDetail[];
  }
}
